<template>
  <div class="app-content">
    <dk-form ref="formRef" :form-data="formData" @submit="onSubmit" />
  </div>
</template>

<script setup>
import { ref, onMounted } from 'vue'
import { getPlaid } from '@/utils/auth'
import { getDouyinEditForm } from '@/api/platform/douyin'

const formRef = ref(null)
const formData = ref(null)
const plaid = ref(0)

const onSubmit = (data, res) => {
  console.log(data, res)
}

const getWechatEditForm = () => {
  getDouyinEditForm(plaid.value).then((res) => {
    formData.value = res.data
    formRef.value?.show()
  })
}

onMounted(() => {
  plaid.value = getPlaid()
  getWechatEditForm()
})
</script>
<style scoped lang="scss">
.search_user {
  background: #f5f7fa;
  padding: 10px;
}
</style>
